import Login from "../page/Login/Login.jsx";
import Article from "../page/Article/Article.jsx";
import { createBrowserRouter, createHashRouter } from 'react-router-dom'
import Layout from "../page/Layout/Layout.jsx";
import Board from "../page/Board/Board.jsx";
import About from "../page/About/About.jsx";
import NotFound from "../page/NotFound/NotFound.jsx";

// 配置哈希路由
const router = createHashRouter([
    {
        path: "/",
        element: <Layout />,
        // 二级路由
        children: [
            {
                // path: "board",
                index: true,
                element: <Board></Board>
            }
            , {
                path: 'about',
                element: <About></About>
            }
        ]
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        // params传参
        path: '/acticle/:id/:name',
        element: <Article />
    },
    {
        path: '*',
        element: <NotFound></NotFound>
    }

])

export default router
